import jsonpath,requests


url = "http://localhost:8000/api/v1/recognition/recognize"

api_key = "5c85256a-b627-4854-bc60-7a7918d0967c"

file_path="C:/Users/Haolin/Desktop/face/9.jpg"

headers = {
    'x-api-key': api_key,
}

files = {
    'file': (file_path, open(file_path, 'rb'), 'image/jpeg'),
}

response = requests.post(url, headers=headers, files=files)

result1 = response.json()

subject_list = jsonpath.jsonpath(result1, '$..subject')
similarity_list = jsonpath.jsonpath(result1, '$..similarity')

print(subject_list, similarity_list)